home *** CD-ROM | disk | FTP | other *** search
/ SCI Games E3 2005 Press Kit (USA) / SCI Games E3 2005 Press Kit (USA).bin / runme_mac.swf / scripts / __Packages / mx / skins / CustomBorder.as < prev    next >
Text File  |  2005-05-05  |  3KB  |  97 lines

  1. class mx.skins.CustomBorder extends mx.skins.Border
  2. {
  3.    static var symbolName = "CustomBorder";
  4.    static var symbolOwner = mx.skins.CustomBorder;
  5.    static var version = "2.0.1.78";
  6.    var className = "CustomBorder";
  7.    static var tagL = 0;
  8.    static var tagM = 1;
  9.    static var tagR = 2;
  10.    var idNames = new Array("l_mc","m_mc","r_mc");
  11.    var leftSkin = "F3PieceLeft";
  12.    var middleSkin = "F3PieceMiddle";
  13.    var rightSkin = "F3PieceRight";
  14.    var horizontal = true;
  15.    function CustomBorder()
  16.    {
  17.       super();
  18.    }
  19.    function get width()
  20.    {
  21.       return this.__width;
  22.    }
  23.    function get height()
  24.    {
  25.       return this.__height;
  26.    }
  27.    function init(Void)
  28.    {
  29.       super.init();
  30.    }
  31.    function createChildren(Void)
  32.    {
  33.    }
  34.    function draw(Void)
  35.    {
  36.       if(this.l_mc == undefined)
  37.       {
  38.          var _loc2_ = this.setSkin(mx.skins.CustomBorder.tagL,this.leftSkin);
  39.          if(this.horizontal)
  40.          {
  41.             this.minHeight = this.l_mc._height;
  42.             this.minWidth = this.l_mc._width;
  43.          }
  44.          else
  45.          {
  46.             this.minHeight = this.l_mc._height;
  47.             this.minWidth = this.l_mc._width;
  48.          }
  49.       }
  50.       if(this.m_mc == undefined)
  51.       {
  52.          this.setSkin(mx.skins.CustomBorder.tagM,this.middleSkin);
  53.          if(this.horizontal)
  54.          {
  55.             this.minHeight = this.m_mc._height;
  56.             this.minWidth += this.m_mc._width;
  57.          }
  58.          else
  59.          {
  60.             this.minHeight += this.m_mc._height;
  61.             this.minWidth = this.m_mc._width;
  62.          }
  63.       }
  64.       if(this.r_mc == undefined)
  65.       {
  66.          this.setSkin(mx.skins.CustomBorder.tagR,this.rightSkin);
  67.          if(this.horizontal)
  68.          {
  69.             this.minHeight = this.r_mc._height;
  70.             this.minWidth += this.r_mc._width;
  71.          }
  72.          else
  73.          {
  74.             this.minHeight += this.r_mc._height;
  75.             this.minWidth = this.r_mc._width;
  76.          }
  77.       }
  78.       this.size();
  79.    }
  80.    function size(Void)
  81.    {
  82.       this.l_mc.move(0,0);
  83.       if(this.horizontal)
  84.       {
  85.          this.r_mc.move(this.__get__width() - this.r_mc.width,0);
  86.          this.m_mc.move(this.l_mc.width,0);
  87.          this.m_mc.setSize(this.r_mc.x - this.m_mc.x,this.m_mc.height);
  88.       }
  89.       else
  90.       {
  91.          this.r_mc.move(0,this.__get__height() - this.r_mc.height,0);
  92.          this.m_mc.move(0,this.l_mc.height);
  93.          this.m_mc.setSize(this.m_mc.width,this.r_mc.y - this.m_mc.y);
  94.       }
  95.    }
  96. }
  97.